package com.ruoyi.system.controller;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.system.domain.JgEquipment;
import com.ruoyi.system.domain.Monitoring;
import com.ruoyi.system.domain.ViewMapData;
import com.ruoyi.system.service.IViewMapDataService;
import com.ruoyi.system.service.JgEquipmentService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 设备监控
 */
@Api("设备监控")
@RestController
@RequestMapping("/monitoring")
public class JgEquipmentController extends BaseController {
    @Autowired
    private IViewMapDataService iViewMapDataService;
    @Autowired
    private JgEquipmentService jgEquipmentService;

    /**
     * 查询所有的设备信息
     * @param
     * @return
     */
    @ApiOperation("查询所有设备的信息")
    @GetMapping("/list")
    public TableDataInfo monitoringList(JgEquipment jgEquipment){
        List<Monitoring>monitoringList=jgEquipmentService.monitoringList(jgEquipment);
        return getDataTable(monitoringList);
    }

    /**
     * 通过设备号或者设备状态查询
     * @param
     * @return
     */
    @ApiOperation("通过设备号或者设备状态查询")
    @GetMapping("/listnumber")
    public TableDataInfo monitorList(String IMEI,String status){
        List<Monitoring>monList=jgEquipmentService.monList(IMEI,status);
        return getDataTable(monList);
    }
    /**
     * 查询最近一天的水浸数据
     */
    @ApiOperation("查询最近一天的水浸数据")
    @GetMapping("/listOneWater/{IMEI}")
    public TableDataInfo monOneWater(@PathVariable("IMEI")String IMEI){
        List<Monitoring>monOneWater=jgEquipmentService.monOneWater(IMEI);
        return getDataTable(monOneWater);
    }
    /**
     * 查询最近一周水浸
     */
    @ApiOperation("查询最近一周水浸")
    @GetMapping("/listSevenWater/{IMEI}")
    public TableDataInfo monSevenWater(@PathVariable("IMEI")String IMEI){
        List<Monitoring>monSevenWater=jgEquipmentService.monSevenWater(IMEI);
        return getDataTable(monSevenWater);
    }
    /**
     * 查询最近一月数据
     */
    @ApiOperation("查询最近一月水浸")
    @GetMapping("/listMonthWater/{IMEI}")
    public TableDataInfo monMonthWater(@PathVariable("IMEI")String IMEI){
        List<Monitoring>monMenthWater=jgEquipmentService.monMenthWater(IMEI);
        return getDataTable(monMenthWater);
    }
    /**
     * 查询最近一年水浸
     */
    @ApiOperation("查询最近一年水浸")
    @GetMapping("/listYearWater/{IMEI}")
    public TableDataInfo monYearWater(@PathVariable("IMEI")String IMEI){
        List<Monitoring>monYearWater=jgEquipmentService.yearWaterList(IMEI);
        return getDataTable(monYearWater);
    }
    /**
     * 查询最近一天倾斜角度
     */
    @ApiOperation("查询最近一天倾斜角度")
    @GetMapping("/listTiltDay/{IMEI}")
    public TableDataInfo listTilt(@PathVariable("IMEI")String IMEI){
        List<Monitoring>ListTiltDay=jgEquipmentService.listTiltDay(IMEI);
        return getDataTable(ListTiltDay);
    }
    /**
     * 查询最近一周倾斜角度
     */
    @ApiOperation("查询最近一周倾斜角度")
    @GetMapping("/listTiltseven/{IMEI}")
    public TableDataInfo listTiltseven(@PathVariable("IMEI")String IMEI){
        List<Monitoring>listTiltseven=jgEquipmentService.listTiltseven(IMEI);
        return getDataTable(listTiltseven);
    }
    /**
     * 查询最近一月的倾斜角度
     */
    @ApiOperation("查询最近一月倾斜角度")
    @GetMapping("/listTiltmonth/{IMEI}")
    public TableDataInfo listTiltmonth(@PathVariable("IMEI")String IMEI){
        List<Monitoring>listTiltmonth=jgEquipmentService.listTiltmonth(IMEI);
        return getDataTable(listTiltmonth);
    }
    /**
     * 查询最近一年倾斜角度
     */
    @ApiOperation("查询最近一年倾斜角度")
    @GetMapping("/listTiltYear/{IMEI}")
    public TableDataInfo listTiltYear(@PathVariable("IMEI")String IMEI){
        List<Monitoring>listTiltYear=jgEquipmentService.listTiltYear(IMEI);
        return getDataTable(listTiltYear);
    }
    /**
     * 查询最近一天电池电压
     */
    @ApiOperation("查询最近一天电池电压")
    @GetMapping("/listBatteryDay/{IMEI}")
    public TableDataInfo listBatteryDay(@PathVariable("IMEI")String IMEI){
        List<Monitoring>listBatteryDay=jgEquipmentService.listBatteryDay(IMEI);
        return getDataTable(listBatteryDay);
    }
    /**
     * 查询最近一周电池电压
     */
    @ApiOperation("查询最近一周电池电压")
    @GetMapping("/listBatteryweek/{IMEI}")
    public TableDataInfo listBatteryweek(@PathVariable("IMEI")String IMEI){
        List<Monitoring>listBatteryweek=jgEquipmentService.listBatteryweek(IMEI);
        return getDataTable(listBatteryweek);
    }
    /**
     * 查询最近一月的电池电压
     */
    @ApiOperation("查询最近一月电池电压")
    @GetMapping("/listBatteryMonth/{IMEI}")
    public TableDataInfo listBatteryMonth(@PathVariable("IMEI")String IMEI){
        List<Monitoring>listBatteryMonth=jgEquipmentService.listBatteryMonth(IMEI);
        return getDataTable(listBatteryMonth);
    }
    /**
     * 查询最近一年的电池电压
     */
    @ApiOperation("查询最近一年电池电压")
    @GetMapping("/listBatteryYear/{IMEI}")
    public TableDataInfo listBatteryYear(@PathVariable("IMEI")String IMEI){
        List<Monitoring>listBatteryYear=jgEquipmentService.listBatteryYear(IMEI);
        return getDataTable(listBatteryYear);
    }
    /**
     * 查询最近一天信噪比
     */
    @ApiOperation("查询最近一天信噪比")
    @GetMapping("/listsnrDay/{IMEI}")
    public TableDataInfo listsnrDay(@PathVariable("IMEI")String IMEI){
        List<Monitoring>listsnrDay=jgEquipmentService.listsnrDay(IMEI);
        return getDataTable(listsnrDay);
    }
    /**
     * 查询最近一周的信噪比
     */
    @ApiOperation("查询最近一周信噪比")
    @GetMapping("/listsnrWeek/{IMEI}")
    public TableDataInfo listsnrWeek(@PathVariable("IMEI")String IMEI){
        List<Monitoring>listsnrWeek=jgEquipmentService.listsnrWeek(IMEI);
        return getDataTable(listsnrWeek);
    }
    /**
     * 查询最近一月信噪比
     */
    @ApiOperation("查询最近一月信噪比")
    @GetMapping("/listsnrMonth/{IMEI}")
    public TableDataInfo listsnrMonth(@PathVariable("IMEI")String IMEI){
        List<Monitoring>listsnrMonth=jgEquipmentService.listsnrMonth(IMEI);
        return getDataTable(listsnrMonth);
    }
    /**
     * 查询最近一年信噪比
     */
    @ApiOperation("查询最近一年信噪比")
    @GetMapping("/listsnrYear/{IMEI}")
    public TableDataInfo listsnrYear(@PathVariable("IMEI")String IMEI){
        List<Monitoring>listsnrYear=jgEquipmentService.listsnrYear(IMEI);
        return getDataTable(listsnrYear);
    }
    /**
     * 查询最近一天信号强度
     */
    @ApiOperation("查询最近一天信号强度")
    @GetMapping("/listRsrpDay/{IMEI}")
    public TableDataInfo listRsrpDay(@PathVariable("IMEI")String IMEI){
        List<Monitoring>listRsrpDay=jgEquipmentService.listRsrpDay(IMEI);
        return getDataTable(listRsrpDay);
    }
    /**
     * 查询最近一周信号强度
     */
    @ApiOperation("查询最近一周信号强度")
    @GetMapping("/listRsrpWeek/{IMEI}")
    public TableDataInfo listRsrpWeek(@PathVariable("IMEI")String IMEI){
        List<Monitoring>listRsrpWeek=jgEquipmentService.listRsrpWeek(IMEI);
        return getDataTable(listRsrpWeek);
    }
    /**
     * 查询最近一月信号强度
     */
    @ApiOperation("查询最近一月信号强度")
    @GetMapping("/listRsrpmonth/{IMEI}")
    public TableDataInfo listRsrpmonth(@PathVariable("IMEI")String IMEI){
        List<Monitoring>listRsrpmonth=jgEquipmentService.listRsrpmonth(IMEI);
        return getDataTable(listRsrpmonth);
    }
    /**
     * 查询最近一年信号强度
     */
    @ApiOperation("查询最近一年信号强度")
    @GetMapping("/listRsrpYear/{IMEI}")
    public TableDataInfo listRsrpYear(@PathVariable("IMEI")String IMEI){
        List<Monitoring>listRsrpYear=jgEquipmentService.listRsrpYear(IMEI);
        return getDataTable(listRsrpYear);
    }
    /**
     * 查询设备详情
     */
    @ApiOperation("查询设备详情")
    @GetMapping("/listParticulars/{IMEI}")
    public TableDataInfo listParticulars(@PathVariable("IMEI")String IMEI){
        List<ViewMapData>listParticulars=iViewMapDataService.listParticulars(IMEI);
        return getDataTable(listParticulars);
    }
}
